package com.rzl.expense.expense.service.impl;

import java.util.List;
import com.rzl.expense.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rzl.expense.expense.mapper.EleContractBackupsMapper;
import com.rzl.expense.expense.domain.EleContractBackups;
import com.rzl.expense.expense.service.IEleContractBackupsService;

/**
 * 电费合同Service业务层处理
 * 
 * @author expense
 * @date 2025-01-09
 */
@Service
public class EleContractBackupsServiceImpl implements IEleContractBackupsService 
{
    @Autowired
    private EleContractBackupsMapper eleContractBackupsMapper;

    /**
     * 查询电费合同
     * 
     * @param elecontractBackupsId 电费合同主键
     * @return 电费合同
     */
    @Override
    public EleContractBackups selectEleContractBackupsByElecontractBackupsId(String elecontractBackupsId)
    {
        return eleContractBackupsMapper.selectEleContractBackupsByElecontractBackupsId(elecontractBackupsId);
    }

    /**
     * 查询电费合同列表
     * 
     * @param eleContractBackups 电费合同
     * @return 电费合同
     */
    @Override
    public List<EleContractBackups> selectEleContractBackupsList(EleContractBackups eleContractBackups)
    {
        return eleContractBackupsMapper.selectEleContractBackupsList(eleContractBackups);
    }

    /**
     * 新增电费合同
     * 
     * @param eleContractBackups 电费合同
     * @return 结果
     */
    @Override
    public int insertEleContractBackups(EleContractBackups eleContractBackups)
    {
        eleContractBackups.setCreateTime(DateUtils.getNowDate());
        return eleContractBackupsMapper.insertEleContractBackups(eleContractBackups);
    }

    /**
     * 修改电费合同
     * 
     * @param eleContractBackups 电费合同
     * @return 结果
     */
    @Override
    public int updateEleContractBackups(EleContractBackups eleContractBackups)
    {
        eleContractBackups.setUpdateTime(DateUtils.getNowDate());
        return eleContractBackupsMapper.updateEleContractBackups(eleContractBackups);
    }

    /**
     * 批量删除电费合同
     * 
     * @param elecontractBackupsIds 需要删除的电费合同主键
     * @return 结果
     */
    @Override
    public int deleteEleContractBackupsByElecontractBackupsIds(String[] elecontractBackupsIds)
    {
        return eleContractBackupsMapper.deleteEleContractBackupsByElecontractBackupsIds(elecontractBackupsIds);
    }

    /**
     * 删除电费合同信息
     * 
     * @param elecontractBackupsId 电费合同主键
     * @return 结果
     */
    @Override
    public int deleteEleContractBackupsByDate(String[] currentDate)
    {
        return eleContractBackupsMapper.deleteEleContractBackupsByDate(currentDate[0],currentDate[1]);
    }




    @Override
    public void batchEleContractBackups(List<EleContractBackups> list)
    {

         eleContractBackupsMapper.batchEleContractBackups(list);
    }


}
